/*
 * MainManager.h
 *
 *  Created on: May 8, 2011
 *      Author: michael
 */

#ifndef MAINMANAGER_H_
#define MAINMANAGER_H_

#include "Sockets/SocketManager.h"
#include "Events/EventDispatcher.h"

namespace DerbyServ
{

class Game;

class MainManager
{
public:
	MainManager();
	virtual ~MainManager();

	void Init();
	void Start();
	void Stop();

	double Time_secs();

	EventDispatcher & GetEventDispatcher();
	SocketManager & GetSocketManager();

private:
	SocketManager _socketManager;
	EventDispatcher _eventDispatcher;
	//boost::shared_ptr<Game> _game;
};
typedef boost::shared_ptr<MainManager> MainManagerPtr;

class MainManagerUser
{
protected:
	inline MainManagerUser(const MainManagerPtr & mgr)
	{
		BOOST_ASSERT(mgr);
		_mgr = mgr;
	}

	MainManagerPtr _mgr;
};


}//namespace

#endif /* MAINMANAGER_H_ */
